package com.cooperate.fly.web;

import java.util.ArrayList;

/**
 * Created by Stellar_Lee on 2016/4/18.
 */
public class BaseTreeNode {
	private int id;
	private String text;
	private String iconCls;
	private String state;
	private int parentId;
	private ArrayList<BaseTreeNode> children = new ArrayList<BaseTreeNode>();
	private boolean checked;
	private boolean isLeaf;
	private int _order;

	public void addChild(BaseTreeNode node) {
		if (!this.children.contains(node)) {
			this.children.add(node);
		}
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public void nodeIsLeaf() {
		if (this.children.isEmpty()) {
			this.isLeaf = true;
		} else {
			this.isLeaf = false;
		}
	}

	public boolean isLeaf() {
		return isLeaf;
	}

	public void setLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public ArrayList<BaseTreeNode> getChildren() {
		return children;
	}

	public void setChildren(ArrayList<BaseTreeNode> children) {
		this.children = children;
	}

	public int get_order() {
		return _order;
	}

	public void set_order(int _order) {
		this._order = _order;
	}
}
